<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-model指令</title>
</head>

<body>
    <div id="app">
        <!-- :value 单向数据绑定 -->
        <input type="text" :value="message" />
        <h1 style="color: cadetblue;">{{message}}</h1>
        <!-- v-model 双向数据绑定 -->
         <!-- @keydown.enter @键盘按下事件.回车键的修饰符 -->
        <input type="text" v-model="message" @keydown.enter="search" />
    </div>
    <script src="./js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                message:'Hello Bye'
            },
            methods:{
                search(){
                    alert(this.message)
                }
            }
        })
    </script>
</body>

</html>